import request from "@/utils/request";

/**  首页订单  数据查询参数 */
export interface DashboardQuery {
  startTime: string;
  endTime: string;
}
/** 首页订单  数据对象 */
export interface DashboardOrderVO {
  orderType: string;
  payAmount: number;
}

/** 首页客户  数据对象 */
export interface DashboardClientVO {
  dateTime: string;
  userNum: number;
}

/** 首页咨询服务  数据对象 */
export interface DashboardConsultationVO {
  num: number;
  serviceStatus: string;
}
class dashboardAPI {
  /** 获取首页订单列表 */
  static getDashboardOrder(params: DashboardQuery) {
    return request<any, DashboardOrderVO[]>({
      url: `/api/pay/order/amountByType?startTime=${params.startTime}&endTime=${params.endTime}`,
      method: "get",
      // data: params,
    });
  }
  /** 获取首页客户新增数列表 */
  static getDashboardClient(params: DashboardQuery) {
    return request<any, DashboardClientVO[]>({
      url: `/api/client_user/getCreateUserNum?startTime=${params.startTime}&endTime=${params.endTime}`,
      method: "get",
      // data: params,
    });
  }
  static getDashboardConsultation(params: DashboardQuery) {
    return request<any, DashboardConsultationVO[]>({
      url: `/api/consultation/getNum?startTime=${params.startTime}&endTime=${params.endTime}`,
      method: "get",
      // data: params,
    });
  }
}

export default dashboardAPI;
